package org.dromara.germbank.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 常见问题
 * 数据库表名：bus_faq_question
 */
@Data
@TableName("bus_faq_question")
public class BusFaqQuestion implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @TableField("id")
    @NotNull(message = "主键id不能为空")
    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer id;

    @TableField("create_time")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @TableField("update_time")
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    @TableField("del_flag")
    @Schema(description = "删除标志（0存在 1删除）")
    private Integer delFlag;

    @TableField("faq_title")
    @NotBlank(message = "问题标题不能为空")
    @Size(max = 200, message = "问题标题长度不能超过200")
    @Length(max = 200, message = "问题标题长度不能超过200")
    @Schema(description = "问题标题", requiredMode = Schema.RequiredMode.REQUIRED)
    private String faqTitle;

    @TableField("faq_category")
    @Size(max = 100, message = "问题分类长度不能超过100")
    @Length(max = 100, message = "问题分类长度不能超过100")
    @Schema(description = "问题分类")
    private String faqCategory;

    @TableField("faq_answer")
    @NotBlank(message = "问题答案不能为空")
    @Schema(description = "问题答案", requiredMode = Schema.RequiredMode.REQUIRED)
    private String faqAnswer;

    @TableField("faq_summary")
    @Schema(description = "内容摘要")
    private String faqSummary;

    @TableField("faq_thumb")
    @Size(max = 255, message = "缩略图URL长度不能超过255")
    @Length(max = 255, message = "缩略图URL长度不能超过255")
    @Schema(description = "缩略图URL")
    private String faqThumb;

    @TableField("faq_is_top")
    @NotNull(message = "是否置顶不能为空")
    @Schema(description = "是否置顶：0否 1是", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer faqIsTop;

    @TableField("faq_sort")
    @NotNull(message = "排序权重不能为空")
    @Schema(description = "排序权重", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer faqSort;

    @TableField("faq_publish_at")
    @Schema(description = "发布时间")
    private LocalDateTime faqPublishAt;

    @TableField("faq_views")
    @NotNull(message = "浏览量不能为空")
    @Schema(description = "浏览量", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer faqViews;

}
